/**
    @project {
        "templateId": "org.helgoboss.custom",
        "version": "0.1-SNAPSHOT",
        "dependencies": [
            "org.scala-lang:scala-library:2.9.0-1",
            "org.helgoboss:commandlet-osgi:0.1-SNAPSHOT"
        ]
    }
*/

package org.helgoboss.demo_commandlet

import org.helgoboss.commandlet.ExecutionContext
import org.helgoboss.commandlet_osgi.OsgiCommandlet
import java.io.PrintWriter

class Activator extends OsgiCommandlet {
	val id = "org.helgoboss.demo"
    
	def execute(context: ExecutionContext) = {
        val writer = new PrintWriter(context.outputStream, true)
        writer.println("Congratulations. Your commandlet platform is up and running.")
        writer.println("Test buffer flushing ...")
        (1 to 3).foreach { i =>
            writer.println(i)
            Thread.sleep(500)
        }
        0
	}
}